package com.startasone.mapper;


import com.startasone.pojo.Emp;
import org.apache.ibatis.annotations.*;
import org.springframework.context.annotation.Scope;

import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;

@Mapper
public interface EmpMapper {
    public List<Emp> getByPage(String name, Short gender, LocalDate start, LocalDate end);

    public void delete(List<Integer> ids);


    @Insert("insert into tlias.emp(username, name, gender, image, job, entrydate, dept_id, create_time, update_time) " +
            "values (#{username},#{name},#{gender},#{image},#{job},#{entrydate},#{deptId},#{createTime},#{updateTime})")
    public void insert(Emp emp);


    @Select("select * from tlias.emp where id=#{id}")
    public Emp getById(Integer id);

    void update(Emp emp);

    @Select("select * from tlias.emp where username=#{username} and password=#{password}")
    Emp getByUsernameAndPassword(Emp emp);

    @Delete("delete  from emp where dept_id=#{id}")
    void deleteByDeptId(Integer id);
}
